﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;

namespace DLM.Data.EF.CodeFirst.Mapping
{
    public class AdminUserMap : EntityTypeConfiguration<AdminUser>
    {
        public AdminUserMap()
        {
            this.HasKey(t =>t.AdminID);
            this.ToTable("AdminUser");
            this.Property(t => t.AdminID).HasColumnName("AdminID");
            this.Property(t => t.Administrator).HasColumnName("Administrator").IsRequired();
            this.Property(t => t.Password).HasColumnName("Password").IsRequired().IsUnicode(false).HasMaxLength(30);
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            //this.Ignore(t => t.Id);
        }
    }
}
